home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / source / constant.e < prev    next >
Encoding:
Text File  |  1995-12-27  |  989 b   |  55 lines

  1.  
  2. -> Copyright © 1995, Guichard Damien.
  3.  
  4. -> Eiffel constants
  5.  
  6. -> TO DO :
  7. ->   unique constants
  8.  
  9. OPT MODULE
  10. OPT EXPORT
  11.  
  12. MODULE '*strings'
  13. MODULE '*ame'
  14. MODULE '*attribut'
  15.  
  16. OBJECT constant OF attribut
  17. PRIVATE
  18.   value:LONG
  19. ENDOBJECT
  20.  
  21. -> Set constant value.
  22. PROC set_value(value) OF constant
  23.   self.value:=value
  24. ENDPROC
  25.  
  26. -> Is feature a constant attribute?
  27. PROC is_constant() OF constant IS TRUE
  28.  
  29. -> Feature value access mode
  30. PROC access() OF constant IS M_IMMEDIATE
  31.  
  32. -> Index for access to feature value
  33. PROC index() OF constant IS self.value
  34.  
  35. -> Make a copy renamed with 'name'
  36. PROC rename(name) OF constant
  37.   DEF other:PTR TO constant
  38.   NEW other
  39.   other.name:=clone(name)
  40.   other.client:=self.client
  41.   other.type:=self.type
  42.   other.value:=self.value
  43. ENDPROC other
  44.  
  45. -> Make a copy exported to 'client'
  46. PROC new_exports(client) OF constant
  47.   DEF other:PTR TO constant
  48.   NEW other
  49.   other.name:=self.name
  50.   other.client:=client
  51.   other.type:=self.type
  52.   other.value:=self.value
  53. ENDPROC other
  54.  
  55.